home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pangomm-1.4 / pangomm / font.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  5.9 KB  |  195 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _PANGOMM_FONT_H
  4. #define _PANGOMM_FONT_H
  5.  
  6. #include <glibmm.h>
  7.  
  8. /* $Id: font.hg,v 1.1.1.1 2003/01/21 13:41:03 murrayc Exp $ */
  9.  
  10. /* font.h
  11.  * 
  12.  * Copyright (C) 1998-1999 The gtkmm Development Team 
  13.  *
  14.  * This library is free software; you can redistribute it and/or
  15.  * modify it under the terms of the GNU Library General Public
  16.  * License as published by the Free Software Foundation; either
  17.  * version 2 of the License, or (at your option) any later version.
  18.  *
  19.  * This library is distributed in the hope that it will be useful,
  20.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.  * Library General Public License for more details.
  23.  *
  24.  * You should have received a copy of the GNU Library General Public
  25.  * License along with this library; if not, write to the Free
  26.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27.  */
  28.  
  29.  
  30. #include <glibmm/object.h>
  31. #include <pangomm/rectangle.h>
  32. #include <pangomm/language.h>
  33. #include <pangomm/glyph.h>
  34. #include <pangomm/fontdescription.h>
  35. #include <pangomm/fontmetrics.h>
  36. #include <pangomm/coverage.h>
  37. #include <pango/pango-font.h>
  38.  
  39.  
  40. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  41. typedef struct _PangoFont PangoFont;
  42. typedef struct _PangoFontClass PangoFontClass;
  43. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  44.  
  45.  
  46. namespace Pango
  47. { class Font_Class; } // namespace Pango
  48. namespace Pango
  49. {
  50.  
  51. const int    SCALE          = 1024;
  52. const double SCALE_XX_SMALL = 0.5787037037037;
  53. const double SCALE_X_SMALL  = 0.6444444444444;
  54. const double SCALE_SMALL    = 0.8333333333333;
  55. const double SCALE_MEDIUM   = 1.0;
  56. const double SCALE_LARGE    = 1.2;
  57. const double SCALE_X_LARGE  = 1.4399999999999;
  58. const double SCALE_XX_LARGE = 1.728;
  59.  
  60.  
  61. /** A Pango::Font is used to represent a font in a rendering-system-independent matter.
  62.  */
  63.  
  64. class Font : public Glib::Object
  65. {
  66.   
  67. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  68.  
  69. public:
  70.   typedef Font CppObjectType;
  71.   typedef Font_Class CppClassType;
  72.   typedef PangoFont BaseObjectType;
  73.   typedef PangoFontClass BaseClassType;
  74.  
  75. private:  friend class Font_Class;
  76.   static CppClassType font_class_;
  77.  
  78. private:
  79.   // noncopyable
  80.   Font(const Font&);
  81.   Font& operator=(const Font&);
  82.  
  83. protected:
  84.   explicit Font(const Glib::ConstructParams& construct_params);
  85.   explicit Font(PangoFont* castitem);
  86.  
  87. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  88.  
  89. public:
  90.   virtual ~Font();
  91.  
  92. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  93.   static GType get_type()      G_GNUC_CONST;
  94.   static GType get_base_type() G_GNUC_CONST;
  95. #endif
  96.  
  97.   ///Provides access to the underlying C GObject.
  98.   PangoFont*       gobj()       { return reinterpret_cast<PangoFont*>(gobject_); }
  99.  
  100.   ///Provides access to the underlying C GObject.
  101.   const PangoFont* gobj() const { return reinterpret_cast<PangoFont*>(gobject_); }
  102.  
  103.   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  104.   PangoFont* gobj_copy();
  105.  
  106. private:
  107.  
  108.    //This would return a PangoEngineShape* but the definition of the struct is surrounded by #define PANGO_ENABLE_BACKEND [...] #endif. So don't wrap it.
  109.  
  110. public:
  111.   
  112.   /** Returns a description of the font.
  113.    * @return A newly-allocated Pango::FontDescription object.
  114.    */
  115.   FontDescription describe() const;
  116.   
  117.   /** Computes the coverage map for a given font and language tag.
  118.    * @param language The language tag.
  119.    * @return A newly-allocated Pango::Coverage object.
  120.    */
  121.   Glib::RefPtr<Coverage> get_coverage(const Language& language) const;
  122.  
  123.   /** Gets overall metric information for a font.
  124.    * The metrics may be substantially different for different scripts.
  125.    * However, this function overload returns the metrics for the entire font.
  126.    */
  127.   FontMetrics get_metrics() const;
  128.   
  129.   /** Gets overall metric information for a font. Since the metrics may be
  130.    * substantially different for different scripts, a language tag can
  131.    * be provided to indicate that the metrics should be retrieved that
  132.    * correspond to the script(s) used by that language.
  133.    * @param language Language tag used to determine which script to get the metrics
  134.    * for.
  135.    * @return A Pango::Metrics object.
  136.    */
  137.   FontMetrics get_metrics(const Language& language) const;
  138.  
  139.   
  140.   /** Gets the logical and ink extents of a glyph within a font. The
  141.    * coordinate system for each rectangle has its origin at the
  142.    * base line and horizontal origin of the character with increasing
  143.    * coordinates extending to the right and down. The macros PANGO_ASCENT(),
  144.    * PANGO_DESCENT(), PANGO_LBEARING(), and PANGO_RBEARING can be used to convert
  145.    * from the extents rectangle to more traditional font metrics. The units
  146.    * of the rectangles are in 1/PANGO_SCALE of a device unit.
  147.    * @param glyph The glyph index.
  148.    * @param ink_rect Rectangle used to store the extents of the glyph as drawn.
  149.    * @param logical_rect Rectangle used to store the logical extents of the glyph.
  150.    */
  151.   void get_glyph_extents(Glyph glyph, Rectangle& ink_rect, Rectangle& logical_rect) const;
  152.  
  153.   /** Get the ink extents of a glyph within the font.
  154.    * @param glyph The glyph index.
  155.    * @return The extents of the glyph as drawn.
  156.    */
  157.   Rectangle get_glyph_ink_extents(Glyph glyph) const;
  158.  
  159.   /** Gets the logical extents of a glyph within the font.
  160.    * @param glyph The glyph index.
  161.    * @return The logical extents of the glyph.
  162.    */
  163.   Rectangle get_glyph_logical_extents(Glyph glyph) const;
  164.  
  165.  
  166. public:
  167.  
  168. public:
  169.   //C++ methods used to invoke GTK+ virtual functions:
  170.  
  171. protected:
  172.   //GTK+ Virtual Functions (override these to change behaviour):
  173.  
  174.   //Default Signal Handlers::
  175.  
  176.  
  177. };
  178.  
  179. } /* namespace Pango */
  180.  
  181.  
  182. namespace Glib
  183. {
  184.   /** @relates Pango::Font
  185.    * @param object The C instance
  186.    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
  187.    * @result A C++ instance that wraps this C instance.
  188.    */
  189.   Glib::RefPtr<Pango::Font> wrap(PangoFont* object, bool take_copy = false);
  190. }
  191.  
  192.  
  193. #endif /* _PANGOMM_FONT_H */
  194.  
  195.